Install Python and Visual Studio Code (Mac) — Interactive Checklist Form

Objective

This guide explains, step by step, how to install:

  • Python
  • Visual Studio Code (VS Code)
  • The Python extension for VS Code
  • A simple test program to confirm everything is working

Review Information

Name

Date

Overall Comments

Before You Start

You need:

  • A Mac computer
  • Internet access
  • Permission to install software

It is a good idea to close unnecessary programs before starting.

Step 1 — Download Python

  1. Open your web browser.

  2. Go to https://www.python.org/downloads/macos/.

  3. Download the latest Python installer for macOS.

  4. Wait for the .pkg file to finish downloading.

Step 2 — Install Python

  1. Open the downloaded Python .pkg installer.

  2. Click Continue through the installation steps.

  3. Click Install.

  4. Enter your Mac password if asked.

  5. Wait for installation to complete.

  6. Click Close when finished.

Step 3 — Verify Python Installation

  1. Open Terminal.

    • Open Finder
    • Go to Applications > Utilities
    • Open Terminal
  2. Type:

python3 --version
  1. Press Return.

You should see something like:

Python 3.x.x
  1. Also test pip by typing:
pip3 --version

Step 4 — If Python Does Not Work

If python3 is not found:

  1. Close Terminal.

  2. Install Python again from python.org.

  3. Open a new Terminal window.

  4. Test again with:

python3 --version

Step 5 — Download Visual Studio Code

  1. Open your web browser.

  2. Go to https://code.visualstudio.com/.

  3. Click Download for Mac.

  4. Wait for the file to download.

Step 6 — Install Visual Studio Code

  1. Open the downloaded VS Code file.

  2. Drag Visual Studio Code into the Applications folder.

  3. Open Applications.

  4. Double-click Visual Studio Code.

  5. If macOS shows a security message, click Open.

Step 7 — Install the code Command in Terminal

  1. Open VS Code.

  2. Press:

Cmd + Shift + P
  1. Type:
Shell Command: Install 'code' command in PATH
  1. Click the command.

This allows you to open folders from Terminal using code ..

Step 8 — Install the Python Extension

  1. In VS Code, click the Extensions icon on the left.

  2. In the search box, type:

Python
  1. Find Python by Microsoft.

  2. Click Install.

Step 9 — Open a Working Folder

  1. In VS Code, click File > Open Folder.

  2. Create or choose a folder for Python work.

Example:

/Users/YourName/Documents/Python-Projects
  1. Click Open.

Step 10 — Create a Test Python File

  1. In VS Code, click File > New File.

  2. Save the file as:

test.py
  1. Add the following code:
print("Hello Yahya - Python is working on Mac!")
  1. Save the file.

Step 11 — Select the Python Interpreter

  1. Press:
Cmd + Shift + P
  1. Type:
Python: Select Interpreter
  1. Click it.

  2. Select the installed Python 3 interpreter.

Step 12 — Run the Test Program

You can run the file in either of these ways.

Option A — Run from VS Code Button

  1. Open test.py.

  2. Click the Run button.

  3. Check the terminal output.

Option B — Run from Terminal

  1. In VS Code, click Terminal > New Terminal.

  2. Type:

python3 test.py
  1. Press Return.

Expected result:

Hello Yahya - Python is working on Mac!

Step 13 — Install Common Python Packages

In the VS Code terminal, type:

pip3 install pandas matplotlib numpy openpyxl

Press Return.

Step 14 — Check Installed Packages

To confirm installation, type:

pip3 list

Look for packages such as:

  • pandas
  • matplotlib
  • numpy
  • openpyxl

Step 15 — Optional: Install Homebrew

Homebrew is a package manager for Mac.

To install Homebrew, open Terminal and run:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

After Homebrew is installed, you can also install Python using:

brew install python

Check it with:

python3 --version

Step 16 — Useful Mac Notes

  • On Mac, use python3 instead of python in most cases.
  • On Mac, use pip3 instead of pip in most cases.
  • If VS Code does not immediately find Python, restart VS Code.
  • If Terminal does not see the new installation, close and reopen Terminal.

Troubleshooting

Problem 1 — python3 not recognized

Fix:

  • Reinstall Python from python.org
  • Open a new Terminal window
  • Test again

Problem 2 — VS Code cannot find interpreter

Fix:

  • Press Cmd + Shift + P
  • Select Python: Select Interpreter
  • Choose the correct Python 3 version

Problem 3 — Permission error with pip

Try:

pip3 install --user pandas matplotlib numpy openpyxl

Problem 4 — code command not found

Fix:

  • Open VS Code
  • Run Shell Command: Install 'code' command in PATH
  • Restart Terminal

Summary

You have now completed the following:

  • Installed Python on Mac
  • Installed Visual Studio Code
  • Installed the Python extension
  • Enabled the code command
  • Selected the Python interpreter
  • Created and ran a test Python file
  • Installed common Python packages

Next Suggested Step

Create a second file named:

hello.py

Add:

name = input("What is your name? ")
print("Hello", name)

Then run:

python3 hello.py